<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>websocket测试页面 </title>

    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/socket.js"></script>

    <script type="text/javascript">
        var socket;
        function connection() {
               socket=createScoket("123456");
        }

        function sendMsg() {
             var msg= $("#msg").val();
             socket.send(msg);
        }

    </script>
</head>
<body>

<input type="button" value="建立连接" onclick="connection()" />
<hr/>
<input type="text" id="msg"/>
<hr/>
<input type="button" value="发送消息" onclick="sendMsg()" />


</body>
</html>